package com.telephone.purchase.service.impl;

import com.telephone.purchase.dao.UserDao;
import com.telephone.purchase.entity.User;
import com.telephone.purchase.model.UserInfoModifyRequest;
import com.telephone.purchase.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author fengyingeng
 * @date 2019/9/4 17:24
 * Description:
 */
@Service
public class UserInfoServieImpl implements UserInfoService {

    @Autowired
    private UserDao userDao;

    @Override
    public int modifyUserInfo(UserInfoModifyRequest userInfoModifyRequest) {

        return userDao.flushUserInfo(userInfoModifyRequest);
    }

    @Override
    public int modifyUserPassword(String phoneNumber, String newUserPassword) {
        return userDao.flushUserPassword(phoneNumber, newUserPassword);
    }

    @Override
    public int modifyPayPassword(String phoneNumber, String newPayPassword) {
        return userDao.flushPayPassword(phoneNumber, newPayPassword);
    }

    @Override
    public User getUserInfo(String phoneNumber) {
        return userDao.selectUserInfo(phoneNumber);
    }
}
